package temp;

/**
 * @ClassName:
 * @Description: 使用异或运算交换两个数
 * @Author fcb
 * @Date 2020/5/23 17:56
 */
public class SwapTest {

    public static void main(String[] args) {
        int x = 2;
        int y = 3;

        x = x ^ y;
        System.out.println("x:"+ x);
        y = x ^ y;
        System.out.println("y:" + y);
        x = x ^ y;
        System.out.println("x:" + x);
    }

}
